//
//  tipVC.swift
//  fakeUI
//
//  Created by fox on 2021/9/23.
//

import Foundation
import UIKit

class tipVC: UIViewController {

    
    override func viewDidLoad() {
        view.backgroundColor = .white
        super.viewDidLoad()
        let upperLabel = UILabel()
        let detailLabel = UILabel()
        let continueBtn = UIButton()
        
        view.addSubview(upperLabel)
        view.addSubview(detailLabel)
        view.addSubview(continueBtn)

        //MARK:- upperLabel约束
        upperLabel.snp.makeConstraints { (make) in
            make.top.equalToSuperview().offset(100)
            make.centerX.equalToSuperview()
        }
        let textAttributes = [NSAttributedString.Key.font:UIFont.systemFont(ofSize: 36, weight: .bold),NSAttributedString.Key.foregroundColor:UIColor.black]
        upperLabel.attributedText = NSAttributedString(string: "温馨提示", attributes: textAttributes)
        
        //MARK:- detailLabel约束
        detailLabel.snp.makeConstraints { (make) in
            make.top.equalTo(upperLabel.snp.bottom).offset(50)
            make.centerX.equalToSuperview()
            make.width.equalToSuperview().dividedBy(1.5)
        }
        let detailAttributes = [NSAttributedString.Key.font:UIFont.systemFont(ofSize: 18, weight: .light),NSAttributedString.Key.foregroundColor:UIColor.gray]
        detailLabel.attributedText = NSAttributedString(string: "\"为了应用的使用能够更贴切您的使用情况，我们邀请您参与视觉测试。\"", attributes: detailAttributes)
        detailLabel.lineBreakMode = .byCharWrapping
        detailLabel.numberOfLines = 0
        
        //MARK:- continueBtn约束
        continueBtn.snp.makeConstraints { (make) in
            make.top.equalTo(view.snp.bottom).offset(-150)
            make.centerX.equalToSuperview()
            make.width.equalToSuperview().dividedBy(1.5)
            make.height.equalTo(50)
        }
        let continueAttributes = [NSAttributedString.Key.font:UIFont.systemFont(ofSize: 18, weight: .light),NSAttributedString.Key.foregroundColor:UIColor.gray]
        continueBtn.setTitle("继续", for: .normal)
//        continueBtn.addTarget(<#T##target: Any?##Any?#>, action: <#T##Selector#>, for: <#T##UIControl.Event#>)
        continueBtn.backgroundColor = #colorLiteral(red: 0.8417847157, green: 0.8507048488, blue: 0.8811554909, alpha: 1)
        continueBtn.layer.cornerRadius = 10
        
    }
    @objc func nextVC(){
        let nextvc = testVC()
        self.present(nextvc, animated: true, completion: nil)
    }
    
        
        
        
        
}
